package com.chengdu.third.dao;

import com.chengdu.third.pojo.Tsfk;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ITsfkDao {

    /**
     * 查找所有
     * @return
     */
    @Select("select * from tsfk")
    public List<Tsfk> find();

    /**
     * 根据id删除
     * @param id
     */
    @Delete("delete from tsfk where id  = #{id}")
    public void delete(long id);

    /**
     * 根据id修改
     * @param tsfk
     */
    @Update("update tsfk set Complaint_name = #{Complaint_name},content = #{content},Handle_name = #{Handle_name} where id = #{id}")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    public void update(Tsfk tsfk);

    /**
     * 增加地区
     * @param tsfk
     */
    @Insert("insert into  tsfk(`id`,`Complaint_name`,`content`,`Handle_name`) values(#{id},#{Complaint_name},#{content},#{Handle_name})")
    public void add(Tsfk tsfk);

    /**
     * 根据id查询
     * @param id
     * @return
     */
    @Select("select * from tsfk where id = #{id}")
    public Tsfk getTsfkById(long id);
}
